package org.leo.dm.example.plugin;

import java.util.UUID;

import org.leo.dm.component.plugin.columnplugin.ColumnPlugin;

public class PluginColumnCustom extends ColumnPlugin {

	int num = 0;

	@Override
	public String handle(String segmentName, String columnName, String columnValue) throws Exception {
		num++;
		if ("LOCAL_ID".equals(columnName.toUpperCase())) {
			if (num % 3 == 0) {
				columnValue = columnValue + "0";
			} else {
				columnValue = columnValue + "1";
			}

		}
		if ("ID".equals(columnName.toUpperCase())) {
			columnValue = UUID.randomUUID().toString();
		}

		return columnValue;
	}

}
